home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / CSMP Digests / csmp-v1-044.txt < prev    next >
Encoding:
Text File  |  1992-11-18  |  50.8 KB  |  1,428 lines  |  [TEXT/MPS ]

  1. C.S.M.P. Digest             Tue, 07 Apr 92       Volume 1 : Issue 44
  2.  
  3. Today's Topics:
  4.  
  5.     Speech synthesis toolkit
  6.     Using Think C with the new Apple #includes
  7.     Tail Patches
  8.     Using Think C with new #includes, part II
  9.      MacApp3 & C++
  10.     Question about SWIM programming
  11.     char to keycodes
  12.     New Programmer Needs Help!!
  13.     Speaker-independent continuous-speech recogni
  14.     How do I pass a string to an object in THINK C?
  15.     FixMul tip
  16.     Very Simple Questions
  17.     "Please insert disk ^0" Help
  18.     Error recovery in THINK C (was Re: Suggestion to the Developers of Think C)
  19.  
  20.  
  21. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  22.  
  23. These digests are available (by using FTP, account anonymous, your email
  24. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  25. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  26. Questions list.
  27.  
  28. These digests are also available via email.  Just send a note saying that you
  29. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  30. automatically receive each new digest as it is created.
  31.  
  32. The articles in these digests are taken directly from comp.sys.mac.programmer.
  33. They are not edited; all articles included in this digest are in their original
  34. posted form.  The only articles that are -not- included in these digests are
  35. those which didn't receive any replies (except those that give information
  36. rather than ask a question).  All replies to each article are concatenated
  37. onto the original article in the order in which they were received.  Article
  38. threads are not added to the digests until the last article added to the
  39. thread is at least one month old (this is to ensure that the thread is dead
  40. before adding it to the digests).
  41.  
  42. Send administrative mail to mkelly@cs.uoregon.edu.
  43.  
  44. -------------------------------------------------------
  45.  
  46. From: mcnichol@terminator.psy.syr.edu (Brendan T. McNichols)
  47. Subject: Speech synthesis toolkit
  48. Date: 2 Mar 92 18:37:49 GMT
  49.  
  50.  
  51. Hi all,
  52.  
  53. I was wondering if anyone out there knows of any speech synthesis  
  54. toolkits for the Mac.  That is, something which will take a file of text  
  55. and turn into speech with appropriate pauses and voice inflections.  I  
  56. know there is a group working on this on NeXT workstations, but haven't  
  57. heard anything from the mac world.
  58.  
  59. Thanks,
  60. Brendan
  61.  
  62. --
  63. Brendan T. McNichols, Computer Engineer               (315) 443-9902
  64. Psyracuse U. Sychology Dept.             mcnichol@psy.syr.edu (NeXT)
  65. 430 Huntington Hall               mcnichol@rodan.acs.syr.edu (ASCII)
  66. Syracuse, NY 13244                              mcnichol@suvm.bitnet
  67.  
  68.  
  69.  
  70. - -------------------------
  71.  
  72. From: kuryakin@bcstec.boeing.com (Rick Pavek)
  73. Date: 3 Mar 92 22:51:10 GMT
  74. Organization: Boeing
  75.  
  76. In article <1992Mar2.133749.29480@newstand.syr.edu> mcnichol@mailbox.syr.edu writes:
  77. >
  78. >Hi all,
  79. >
  80. >I was wondering if anyone out there knows of any speech synthesis  
  81. >toolkits for the Mac.  That is, something which will take a file of text  
  82.  
  83. Yesterday, on Good Morning America, John Scully and one of the Apple   
  84. Engineers (the inventor) displayed Casper, the talking computer.
  85.  
  86. The computer spoke with near human quality speech, understood spoken commands from Joan London, John and the Employee, and showed how Apple Computer intends
  87. to develop it's product.
  88.  
  89. Looked neat as stuff.  They selected text, pasted into MacWrite, changed
  90. the font, size and style of text, and did all kinds of things.
  91.  
  92. They indicated it was still a prototype.  Why they announced it, I don't know.
  93. Perhaps they had it developed far enough along that they could display it
  94. to the public and beat someone else (TI?) to it.
  95.  
  96. All I know is...  I want it.
  97.  
  98. Cheers
  99.  
  100. - -- 
  101. Rick Pavek                          v-------------------------------v
  102. kuryakin@bcstec.boeing.com          v IBM     UBM     We all BM     v
  103. AppleLink:  kuryakin                v              4IBM             v
  104. GEnie:      r.pavek1                v-------------------------------v
  105.  
  106. - -------------------------
  107.  
  108. From: mcnichol@terminator.psy.syr.edu (Brendan T. McNichols)
  109. Date: Wed, 4 Mar 92 13:00:19 EST
  110.  
  111. >In article <1954@bcstec.boeing.com> kuryakin@bcstec.boeing.com (Rick 
  112. >Pavek) writes:
  113. >In article <1992Mar2.133749.29480@newstand.syr.edu> 
  114. >mcnichol@mailbox.syr.edu writes:
  115. >>
  116. >>Hi all,
  117. >>
  118. >>I was wondering if anyone out there knows of any speech synthesis  
  119. >>toolkits for the Mac.  That is, something which will take a file of 
  120. >>text  
  121. >
  122. >Yesterday, on Good Morning America, John Scully and one of the Apple   
  123. >Engineers (the inventor) displayed Casper, the talking computer.
  124. >
  125. >The computer spoke with near human quality speech, understood spoken 
  126. >commands from Joan London, John and the Employee, and showed how Apple 
  127. >Computer intends to develop it's product.
  128. >
  129. >Looked neat as stuff.  They selected text, pasted into MacWrite, changed
  130. >the font, size and style of text, and did all kinds of things.
  131. >
  132. >They indicated it was still a prototype.  Why they announced it, I don't 
  133. >know.  Perhaps they had it developed far enough along that they could 
  134. >display it to the public and beat someone else (TI?) to it.
  135.  
  136. Actually, they didn't beat anyone.  The technology that Caspar is based  
  137. upon was developed fully on NeXT workstations at Carnegie-Mellon and is  
  138. available as a commercial product as we speak from the commercial arm of  
  139. CMU, called Visus.  This is not actually what my original post was about,  
  140. though, what I need is text-to-speech software, not speech recognition  
  141. software.  Anyway, I need SOFTWARE, not VAPORWARE!  :)  :)  :)
  142.  
  143. >
  144. >All I know is...  I want it.
  145. >
  146.  
  147. Then buy a NeXT!  :)
  148.  
  149. >Cheers
  150. >
  151.  
  152. Cheers to you too!
  153. Brendan
  154.  
  155. >-- 
  156. >Rick Pavek                          v-------------------------------v
  157. >kuryakin@bcstec.boeing.com          v IBM     UBM     We all BM     v
  158. >AppleLink:  kuryakin                v              4IBM             v
  159. >GEnie:      r.pavek1                v-------------------------------v
  160. >
  161. - --
  162. Brendan T. McNichols, Computer Engineer               (315) 443-9902
  163. Psyracuse U. Sychology Dept.             mcnichol@psy.syr.edu (NeXT)
  164. 430 Huntington Hall               mcnichol@rodan.acs.syr.edu (ASCII)
  165. Syracuse, NY 13244                              mcnichol@suvm.bitnet
  166.  
  167. ---------------------------
  168.  
  169. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  170. Subject: Using Think C with the new Apple #includes
  171. Date: 2 Mar 92 22:05:03 GMT
  172. Organization: Kalamazoo College
  173.  
  174. On the February 1992 CD ("20000 Leagues under the CD"), Apple provided
  175. the new MPW includes:  version 3.2.1.  If you want to use those headers,
  176. there are a few small changes to make.  I found a few of them on my own.
  177. Symantec will probably come out with the official new headers soon, but
  178. these work for me.
  179.  
  180. The following changes are necessary to get my own large TCL project to
  181. work.  Your mileage may vary:
  182.  
  183. In Sound.h
  184. - --------
  185.  
  186. replace:
  187. typedef long Time;
  188.  
  189. with:
  190. #if !THINK_C
  191. typedef long Time;
  192. #endif
  193.  
  194. replace:
  195.     Time wait;
  196.  
  197. with:
  198. #if THINK_C
  199.     long wait;
  200. #else
  201.     Time wait;
  202. #endif
  203.  
  204.  
  205. In Types.h
  206. - --------
  207.  
  208. Cut the #if THINK_C...#endif group (15 lines or so) from the old
  209. Types.h, and paste it just after the line "#define __TYPES__".
  210.  
  211. replace:
  212. #define nil 0
  213.  
  214. with:
  215. #ifndef nil
  216. #define nil 0
  217. #endif
  218.  
  219. Around the "#ifdef mc68881...#else...#endif" group (10 lines or so), put
  220. "#if !THINK_C" and "#endif".
  221.  
  222. replace:
  223. typedef long (*ProcPtr)();
  224.  
  225. with:
  226. #if !THINK_C
  227. typedef long (*ProcPtr)();
  228. #endif
  229.  
  230.  
  231. In QuickDraw.h
  232. - ------------
  233.  
  234. Search for the text "danger", and read the note about the new definition
  235. of "Pattern".  Note that at least one TCL class, CPaneBorder, wants the
  236. old definition.
  237.  
  238. To be compatible, insert directly before the first enum in the file:
  239. #define dangerousPattern
  240.  
  241.  
  242. In Traps.h
  243. - --------
  244.  
  245. Insert, somewhere, the line:
  246. #define _GestaltDispatch 0xA0AD
  247.  
  248. [Note:  I think this trap was only accessed from CApplication.c;  if
  249. you're not using the TCL, you probably won't need to change this.]
  250.  
  251.  
  252. Remember to re-compile precompiled headers after making any changes, and
  253. you may want to "Use Disk" to force THINK C to recognize that the
  254. headers have changed.
  255. -- 
  256.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  257.  Kzoo randomly kills all my mail;  if I don't acknowledge, try resending.    
  258.  
  259.  
  260.  
  261. - -------------------------
  262.  
  263. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  264. Date: 3 Mar 92 22:38:51 GMT
  265. Organization: Symantec Corp.
  266.  
  267. In article <1992Mar2.220503.24053@hobbes.kzoo.edu> k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
  268.  
  269.    On the February 1992 CD ("20000 Leagues under the CD"), Apple
  270.    provided the new MPW includes: version 3.2.1.  If you want to use
  271.    those headers, there are a few small changes to make.  I found a
  272.    few of them on my own.  Symantec will probably come out with the
  273.    official new headers soon, but these work for me.
  274.  
  275. It's unclear if this will happen or not. We did a diff on all of the
  276. header files, and (as far as I know) didn't find anything that much
  277. different. They mostly changed the spacing for a bunch of prototypes
  278. and changed a ton of #defines to enums (or vice versa, I forget).
  279.  
  280.    Search for the text "danger", and read the note about the new
  281.    definition of "Pattern".  Note that at least one TCL class,
  282.    CPaneBorder, wants the old definition.
  283.  
  284.    To be compatible, insert directly before the first enum in the
  285.    file: #define dangerousPattern
  286.  
  287. Remember all of that flak about THINK C 5.0 aligning even-sized
  288. character arrays in structures? Well, this was part of what that
  289. feature was intended to fix. If you don't turn off the array alignment
  290. in C 5.0, then the old, "dangerous" Pattern type will work fine on
  291. 68000 machines. See Appendix J in the MPW 3.2 Release Notes on ETO #6
  292. for more info about this problem.
  293.  
  294.     -phil
  295. - --
  296.    Phil Shapiro                                   Software Engineer
  297.    Language Products Group                     Symantec Corporation
  298.            Internet: phils@cs.brandeis.edu
  299.  
  300. ---------------------------
  301.  
  302. From: scott@mcl.mcl.ucsb.edu (Scott Bronson)
  303. Subject: Tail Patches
  304. Date: 2 Mar 92 22:07:45 GMT
  305.  
  306. This seems like it would be a fairly common question, but I have not
  307. been able to find any FAQ adressing it.
  308.  
  309. How does one intercept keyboard and mouse events without writing a tail
  310. patch?  I understand tail patching is a bad thing because it may break
  311. any bug fixes Apple releases that relies on the address of the trap.
  312. I've lived under that rule (happily) so far, because with a bit of artful
  313. coding, one can usually get around that restriction (for instance, rather
  314. than patching CopyBits, patching GetResource is a much better idea.  I was
  315. rather proud of that one).
  316.  
  317. However, I can see no way to intercept and dispose of keyboard events
  318. without tail patching GNE or WNE.  Mouse events are taken care of quite
  319. nicely by a patch to FindWindow, but I was surprised at how few
  320. applications actually call MenuKey after recieving a keydown event with
  321. the command key held down.
  322.  
  323. I also can't figure out how to intercept the user selecting a menu item
  324. without tail patching MenuSelect or MenuKey.  The user gets to choose
  325. which items he or she wants to intercept, so I don't think I can take
  326. care of the event before the Menu Manager gets ahold of it.  Then Apple
  327. says I can't take care of it immediately afterwards.
  328.  
  329. How do macro programs do it?  Is patching the keyboard driver or the
  330. ADB manager viable?  I sure hope not--that sounds like an inherently
  331. unstable idea.
  332.  
  333. Do any of you have any ideas of where to look for docs describing this,
  334. or what traps to patch to intercept these events?  Would there happen to
  335. be any sample code out?  Thanks very much for *any* help at all you might
  336. be able to offer!
  337.  
  338.  
  339.    - Scott            +----------------: SCOTT BRONSON :-----------------+
  340. +---------------------|  scott@mcl.ucsb.edu    2025sbsb@ucsbuxa.ucsb.edu |
  341. |       /_  /)        | 6850 El Colegio Road #234; Goleta, CA 93117-4300 |
  342. |        / /_)        +==================================================+
  343. +=========================+
  344.  
  345.  
  346.  
  347. - -------------------------
  348.  
  349. From: ari@eclectic.com (Ari Halberstadt)
  350. Organization: Eclectic Associates, Inc.
  351. Date: Tue, 3 Mar 1992 05:06:00 GMT
  352.  
  353. In article <scott.699574065@mcl> scott@mcl.mcl.ucsb.edu (Scott Bronson) writes:
  354. >How does one intercept keyboard and mouse events without writing a tail
  355. >patch?  I understand tail patching is a bad thing because it may break
  356. >any bug fixes Apple releases that relies on the address of the trap.
  357.  
  358. For GNE, you can write a filter whose address is stored in the GNEFilter
  359. low memory global. WNE calls GNE, so this will work. You can also head
  360. patch GNE, then use OSEventAvail (don't use EventAvail) to see if
  361. the event of interest is in the queue. To change the event using this
  362. method you'd probably have to walk the event queue, which is not a good
  363. idea (despite poor DTS sample code supposedly showing how to check
  364. for command-period while processing an Apple Event). Another, probably
  365. safer method to change events is to patch PostEvent. Then you can change the
  366. event before it ever gets into the queue! Of course, update and activate
  367. events are never placed in the regular queue, but from your post it
  368. sounds like you're only interested in mouse and keyboard events.
  369.  
  370. >I also can't figure out how to intercept the user selecting a menu item
  371. >without tail patching MenuSelect or MenuKey.  The user gets to choose
  372. >which items he or she wants to intercept, so I don't think I can take
  373. >care of the event before the Menu Manager gets a hold of it.  Then Apple
  374. >says I can't take care of it immediately afterwards.
  375.  
  376. The patches and GNE filter described above should be able to modify
  377. events which MenuKey would see. I don't know how to get around the
  378. MenuSelect problem; I'm actually quite curious about MenuSelect,
  379. since there are so many menu enhancing utilities which must modify
  380. its behavior.
  381.  
  382. >How do macro programs do it?
  383.  
  384. One way macro programs can work is by using the Event Manager's journaling
  385. mechanism, but I'm not sure if that method is still fully supported.
  386. Another way is to post events into the queue (using PostEvent). The most
  387. modern approach is to use a scripting language and Apple Events, though
  388. your market may be a little limited since not many programs fully implement
  389. Apple Events.
  390. - -- 
  391. Ari Halberstadt       ari@eclectic.com             #include <std/disclaimer.h>
  392. Ramsgate (n.) All institutional buildings must, by law, contain at least twenty
  393. ramsgates. These are doors that open the opposite way to the one you expect.
  394.     -- D. Adams & J. Lloyd "The Meaning of Liff", p75.
  395.  
  396. - -------------------------
  397.  
  398. Organization: Penn State University
  399. Date: Tuesday, 3 Mar 1992 03:40:40 EST
  400. From: Christopher Tate <CXT105@psuvm.psu.edu>
  401.  
  402. In article <1992Mar3.050600.6149@eclectic.com>, ari@eclectic.com (Ari
  403. Halberstadt) says:
  404. >
  405. >For GNE, you can write a filter whose address is stored in the GNEFilter
  406. >low memory global. WNE calls GNE, so this will work.
  407.  
  408. I'm starting to discover that the jGNEFilter hook isn't entirely
  409. reliable.  There are times when my filter routine seems not to get
  410. called at all, for various amounts of time (more than a minute, in
  411. some cases).
  412.  
  413. This is all under System 7 on a IIsi.
  414.  
  415. Has anyone else observed this behavior?  I don't recall running into
  416. any such problems with System 6; did System 7 change the way the
  417. jGNEFilter was handled?
  418.  
  419. - -------
  420. Christopher Tate     | Cryptogram #25:
  421. cxt105@psuvm.psu.edu |
  422. CXT105@PSUVM.BITNET  | "AUBE IBPB CQHA JPGYZMPE NJHAXBZ, SJZG JS
  423. - ---------------------|  IMWFYZK MZG GJKH MZG *VUPYHAXMH MZG AUB HZJI."
  424. "*" == proper nouns  |             -- "M VUYWG'H *VUPYHAXMH YZ *IMWBH"
  425.  
  426. ---------------------------
  427.  
  428. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  429. Subject: Using Think C with new #includes, part II
  430. Organization: Kalamazoo College
  431. Date: Mon, 2 Mar 1992 22:34:17 GMT
  432.  
  433. In QDOffscreen.h
  434. - --------------
  435.  
  436. Open the old QDOffscreen.h and cut the lines that begin..
  437. #if THINK_C
  438.     mapPix = 1L << mapPixBit,
  439.     newDepth = 1L << newDepthBit,
  440.  
  441. ...and end...
  442.     gwFlagErr = 1 << gwFlagErrBit
  443. #endif
  444.  
  445. Open the new QDOffscreen.h.  Replace the lines defining mapPix through
  446. gwFlagErr with the lines from the old QDOffscreen.h.
  447.  
  448.  
  449. In PrintTraps.h
  450. - -------------
  451.  
  452. Apple has removed the inline code from all the old print traps'
  453. definitions.  There doesn't seem to be an appropriate library to
  454. include, either.  My fix was to replace the 25 definitions in the new
  455. Printing.h, from PrPurge() to PrDrvrVers(), with the 25 declarations
  456. from the old PrintTraps.h, from PrPurge() to PrStlInit().  I'd think
  457. there'd be a better way to do this, though...
  458. -- 
  459.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  460.  Kzoo randomly kills all my mail;  if I don't acknowledge, try resending.    
  461.  
  462.  
  463.  
  464. - -------------------------
  465.  
  466. From: Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier)
  467. Date: Tue, 03 Mar 1992 01:42:02 -0500
  468.  
  469.  JR> From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  470.  
  471.  JR> Apple has removed the inline code from all the old print traps'
  472.  JR> definitions.
  473.  
  474. Yowza! I noticed this one earlier today. WHY on earth would they do such
  475. a thing? I can only imagine the new glue checks for the existence of the
  476. trap, then runs the glue if it's not there, but how many people develop
  477. for systems which require that nowadays? Can't those people just be stuck
  478. with using "Printing.h" instead of "PrintTraps.h"? Is DTS really spending
  479. so much time answering dumb questions about the difference between the
  480. two files? Why not just document the differences *inside the two files*?
  481.  
  482. Sorry to rave, but I'm the kind of guy who defines SystemSevenOrLater
  483. because the Gestalt glue calls GetTrapAddress twice before _GestaltDispatch,
  484. which I already did, dammit, and I don't want anybody using anything
  485. scary like System 6.0.3 in 1992 anyway.
  486.  
  487. ---------------------------
  488.  
  489. From: zaveri@Apple.COM (Ameet Zaveri)
  490. Subject:  MacApp3 & C++
  491. Date: 3 Mar 92 00:21:14 GMT
  492. Organization: Apple Computer Inc., Cupertino, CA
  493.  
  494. In article <u_banzai.699236134@mcl> u_banzai@mcl.mcl.ucsb.edu (Buckaroo Banzai) writes:
  495. >So, when IS MacApp 3.0 coming out??????
  496.  
  497. MacApp 3.0 will be available on ETO #7 which should reach developers in
  498. mid-March. It is in production and shipping right now.
  499.  
  500. - - ameet zaveri
  501.  
  502.  
  503.  
  504. - -------------------------
  505.  
  506. From: ksand@apple.com (Kent Sandvik)
  507. Date: 5 Mar 92 20:30:56 GMT
  508. Organization: MacDTS Mongols
  509.  
  510. In article <u_banzai.699236134@mcl>, u_banzai@mcl.mcl.ucsb.edu (Buckaroo Banzai) writes:
  511. > So, when IS MacApp 3.0 coming out??????
  512. > Anyone know?
  513.  
  514. Golden Master is ready, and is shipping with the ETO#7 out next week or so. The
  515. final APDA product will be ready later when documentation if final.
  516.  
  517. Kent Sandvik/DLE*)
  518.  
  519. *) DLE - Dynamic Language Evangelist
  520.  
  521. ---------------------------
  522.  
  523. From: lkelly@oasys.dt.navy.mil (Lawrence Kelly)
  524. Subject: Question about SWIM programming
  525. Date: 3 Mar 92 01:07:11 GMT
  526. Organization: Carderock Division, NSWC, Bethesda, MD
  527.  
  528. Just wondering if anyone has done any type of direct programming of
  529. the SWIM chip in systems so equipped.  Is there a standard Mac system
  530. call to use SWIM commands, or would you have to do direct SWIM register
  531. manipulation?  I am looking into writing an application such like apple
  532. file exchange, but using a specialized format that needs to be read
  533. in pc's.   Any ideas??
  534.  
  535.       Thanks for your help!
  536.  
  537.      -Larry
  538.  
  539.  
  540.  
  541. - -------------------------
  542.  
  543. From: stevec@Apple.COM (Steve Christensen)
  544. Date: 6 Mar 92 05:17:44 GMT
  545. Organization: Apple Computer Inc., Cupertino, CA
  546.  
  547. lkelly@oasys.dt.navy.mil (Lawrence Kelly) writes:
  548.  
  549. >Just wondering if anyone has done any type of direct programming of
  550. >the SWIM chip in systems so equipped.  Is there a standard Mac system
  551. >call to use SWIM commands, or would you have to do direct SWIM register
  552. >manipulation?  I am looking into writing an application such like apple
  553. >file exchange, but using a specialized format that needs to be read
  554. >in pc's.   Any ideas??
  555.  
  556. The only safe way to deal with floppy disks is by calling the floppy
  557. disk driver.  Not doing so means you run into compatibility problems
  558. on the IIfx, Quadra 700, and all of the portables, since dealing with
  559. the SWIM chip on those systems is somewhat non-standard.  The "standard"
  560. interface to the SWIM chip is the floppy driver; there is no other
  561. official support for dealing with the SWIM chip.
  562.  
  563. If the specialized format you're talking about is either the 1MB (9
  564. sectors/track) or 2MB (18 sectors/track) format with 512 byte sectors,
  565. you're in luck since that's what the floppy driver can deal with.  If
  566. it's another format (either different number of sectors/track or different
  567. sector size), you can't get there from here without talking to the
  568. hardware, which is a bad idea.
  569.  
  570. If the format is different because it uses a different file system/
  571. directory structure overlayed on a standard physical format, you'll need
  572. to write a foreign file system to convert the information on the disk
  573. to something the Mac can deal with.  In that case, you don't need to
  574. play around with the disk itself.
  575.  
  576. steve
  577. - -- 
  578. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  579.   Steve Christensen            Never hit a man with glasses.
  580.   stevec@apple.com            Hit him with a baseball bat.
  581.  
  582. ---------------------------
  583.  
  584. From: ghammond@gara.une.oz.au (Gerard Hammond)
  585. Subject: char to keycodes
  586. Date: 3 Mar 92 00:08:39 GMT
  587. Organization: University of New England, Armidale, Australia
  588.  
  589. This may be an easy one? I hope so.
  590.  
  591. In Think PascaL, how do I convert a char variable into the 
  592. the keycode for use with GetKeys.
  593.  
  594. The char is obtained from reading in an edit text box in a dialog 
  595. and then the char is extracted from the string. I then want to 
  596. see if this key is being held done later on so that I can
  597. do the animation. I have tried getnextevent and converted it to char codes
  598. but the keymapping with getkeys is much faster. Hence the problem.
  599.  
  600. System 7.0.0
  601. ci
  602. No VM
  603.  
  604. I no these shouldn't make any difference though.
  605. Thanks very much for any help!
  606.  
  607.  
  608.               /\          
  609.        ___    | \              Gerard Hammond             
  610.      /    \__/   \             ghammond@gara.une.oz.au
  611.     /             \            Dept., of Chemistry 
  612.    /               \           University of New England      
  613.    \             * /           Armidale NSW 2351
  614.     \    ____     /            Australia.
  615.      \__/    \___/        
  616.                __          
  617.                \/           
  618.  
  619. - -------------------------
  620.  
  621. From: ghammond@gara.une.oz.au (Gerard Hammond)
  622. Date: 6 Mar 92 00:16:03 GMT
  623. Organization: University of New England, Armidale, Australia
  624.  
  625.  
  626.  
  627. Here is a summary of replies to a question I asked about how to
  628. convert char variables into keycodes (as in the form generated from the 
  629. getkeys comand.
  630. Thanks to everyone who was interested and those who could help.
  631. best regards
  632.  
  633. Gerard Hammond
  634. ghammond@gara.une.oz.au
  635. (In sunny warm Australia)
  636.  
  637.  
  638. Subject: char to keycodes
  639.  
  640. >From aubourg@lalux5.in2p3.fr Wed Mar  4 00:50:19 1992
  641. To: ghammond@gara.une.oz.au
  642. Status: RO
  643.  
  644. I see 2 solutions
  645. - - Get the keycode first instead of the char in your dialog.
  646. - - Search in KCHR resource. I have a piece of code in Think C that does
  647. this. I wrote this to be able to use an american program badly written
  648. on a french keyboard : I sent him the right char with the american 
  649. equivalent keycode...
  650. The first may be easier for your needs, the second in the only general
  651. purpose way.
  652. Eric Aubourg
  653.  
  654. **********************************
  655.  
  656.  
  657. >From glawrence@ucsd.edu Wed Mar  4 05:00:42 1992
  658. From: glawrence@UCSD.EDU  (Gabriel Lawrence)
  659. Subject: read the keys as a keymap originally...
  660. Status: RO
  661.  
  662.  
  663. This may be an easy one? I hope so.
  664.  
  665. In Think PascaL, how do I convert a char variable into the
  666. the keycode for use with GetKeys.
  667.  
  668. The char is obtained from reading in an edit text box in a dialog
  669. and then the char is extracted from the string. I then want to
  670. see if this key is being held done later on so that I can
  671. do the animation. I have tried getnextevent and converted it to char codes
  672. but the keymapping with getkeys is much faster. Hence the problem.
  673.  
  674. - ------
  675.  
  676. Why not read the keys as a keymap originally?  if that isn't helpful I
  677. think theres something in inside mac about converting.... I don't quite
  678. remember for sure... but check it out...
  679.  
  680.  
  681. ****************************************************
  682.  
  683. >From grobbins@apple.com Thu Mar  5 19:33:01 1992
  684.  
  685. In article <11159@gara.une.oz.au> you write:
  686. >In Think PascaL, how do I convert a char variable into the 
  687. >the keycode for use with GetKeys.
  688.  
  689. Well, the index of the bit in GetKeys is, more or less, the
  690. virtual keycode, and virtual keycodes are converted to
  691. Mac ASCII with KeyTrans (see Inside Mac V, TN 160, and the
  692. international cancelling Tech Note).
  693.  
  694. Good luck...  hope you've gotten it working by now.
  695.  
  696. Grobbins         grobbins@apple.com
  697.  
  698. ---------------------------
  699.  
  700. Organization: Senior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
  701. Date: Tue,  3 Mar 1992 00:52:47 -0500 
  702. From: Vivek Gupta <vg07+@andrew.cmu.edu>
  703. Subject: New Programmer Needs Help!!
  704.  
  705. Hi,
  706.  
  707. I would like to work on a script interface system, but what I have found
  708. in IM I-VI does not explain it well enough for me.  I was wondering
  709. where I could find more documentation on script interface systems and
  710. the Script Manager ???
  711.  
  712. Thanx in advance,
  713. Vivek Gupta
  714.  
  715. - -------------------------
  716.  
  717. Organization: Senior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
  718. Date: Wed,  4 Mar 1992 15:50:36 -0500 
  719. From: Vivek Gupta <vg07+@andrew.cmu.edu>
  720.  
  721. Hi,
  722.  
  723. I would like to work on a script interface system, but what I have found
  724. in IM I-VI does not explain it well enough for me.  I was wondering
  725. where I could find more documentation on script interface systems and
  726. the Script Manager ??? 
  727.  
  728. ANY POINTERS AT ALL WOULD HELP.
  729.  
  730. Thanx in advance,
  731. Vivek Gupta
  732.  
  733.  
  734. ---------------------------
  735.  
  736. From: fry@tara.harvard.edu (David Fry)
  737. Subject: Speaker-independent continuous-speech recogni
  738. Date: 3 Mar 92 09:02:54 GMT
  739. Organization: Harvard Math Department
  740.  
  741. In article <1992Mar2.213902.10558@visix.com> amanda@visix.com (Amanda Walker) writes:
  742. >    <1992Feb27.195556.7047@unx.sas.com>
  743. >sasdtm@stthomas.unx.sas.com (Donald T. Major) writes:
  744. >> All the posts quote Apple as claiming 1 meg of RAM for the product; of
  745. >> course, the article also seems to claim that a relatively small vocab
  746. >> was used for the demo (I seem to recall seeing the figure of 2-300
  747. >> words being mentioned--the article DID say that it wasn't explicitly
  748. >> made clear by Apple).
  749. >
  750. >With that small a vocabulary, it's quite practical, and I'm quite
  751. >willing to believe their claims.  This would, however, limit its
  752. >usefulness as well.  Even so, it would be quite a studly addition to Mac
  753. >system software...
  754.  
  755. Actually, the article doesn't say that is the vocabulary size,
  756. it says that each command is "assocatiated" with 2-300 words,
  757. whatever that means.  Someone else said the vocabulary is
  758. 100,000 words, but that seems outlandish.  On the GMA show
  759. this morning, Kai-Fu Lee said it was tested on thousands of
  760. different speakers and a *trillion* different sentences.
  761. The demo was fairly impressive I suppose, but I can't help but
  762. think I'd feel goofy saying "Casper, open my calendar" all
  763. day.
  764.  
  765. But, like you say, it will definitely be studly.  
  766.  
  767. David Fry                               fry@math.harvard.EDU
  768. Department of Mathematics               fry@huma1.bitnet
  769. Harvard University                      ...!harvard!huma1!fry
  770. Cambridge, MA  02138            
  771.  
  772. - -------------------------
  773.  
  774. From: sk4i+@andrew.cmu.edu (Samuel John Kass)
  775. Date: 3 Mar 92 12:54:29 GMT
  776. Organization: Freshman, MCS general, Carnegie Mellon, Pittsburgh, PA
  777.  
  778.  
  779.    WHen I heard about this, my dream was to get one of them new modems
  780. (you know, the ones with voice digitization from the phone lines, and
  781. voice output over the phone lines), and pipe that through the new voice
  782. recognition/ output.  Then, you call your Mac up, and say, "Hey Mac,
  783. what was I supposed to buy at the grocery market again?"  And in a HAL
  784. like voice it would reply, "Eggs, Milk, and Bread, you moron."
  785.     I suppose there are more practical uses than the above application,
  786. but you get the picture.
  787.     --Sam
  788. P.S. I suppose my command to it would probably, more realistically,
  789. sound like, "Macintosh, Open HD:SamStuff:ShoppingList, Read" but hey, I
  790. can dream.
  791.  
  792. ---------------------------
  793.  
  794. From: wbridgm@hubcap.clemson.edu (William T. Bridgman)
  795. Subject: How do I pass a string to an object in THINK C?
  796. Organization: Clemson University
  797. Date: Tue, 3 Mar 1992 12:54:09 GMT
  798.  
  799. I've checked several sources, including the c++ FAQ (which uses a
  800. different i/o arrangement) and have not found a method that works.
  801. I'm trying to pass a string to an object and then print that string
  802. from the method inside the object.  I can get it to work with
  803. numbers, but it seems to choke on strings, even when I just pass a
  804. pointer.
  805.  
  806. Here is a sample of the minimum code that reproduces the problem:
  807.  
  808. - ---- start here ----
  809. #include <oops.h>
  810. #include <string.h>
  811. #include <stdio.h>
  812.  
  813. #define LENGTH 30
  814.  
  815. /************ Class Definition ************/
  816. class CSample {
  817.     char name[LENGTH];
  818. public:
  819.     void initialize(char n[]);
  820.     void print(void);
  821. };
  822. /********** Method Definitions ************/
  823. void CSample::initialize(char n[])
  824. {
  825.     strcpy(name,n);
  826. }
  827. void CSample::print()
  828. {
  829.     printf("\nModel Name: %s\n",name);
  830. }
  831. /************ Main Program ***************/
  832. main()
  833. {
  834.     CSample *test_run;
  835.     
  836.     test_run=new CSample;
  837.     test_run->initialize("Test");
  838.     test_run->print();
  839.     delete test_run;
  840. }
  841. - ---- end here ----
  842.  
  843. Ideally, this should print:
  844.  
  845. Model Name: Test
  846.  
  847. Instead I get something like:
  848.  
  849. Model Name: (some random garbage characters)
  850.  
  851. Any suggestions as to what I'm doing wrong?
  852.  
  853. Thanks...Tom
  854. - -----------------------------------------------------------------------
  855. |  William T. "Tom" Bridgman, M.S.   | wbridgm@hubcap.clemson.edu     |
  856. |  Department of Physics & Astronomy |                                |
  857. |  Clemson University                |"Black Holes under Construction.|
  858. |  Clemson, SC   29634-1911          |       WATCH YOUR STEP!"        |
  859. - -----------------------------------------------------------------------
  860.  
  861. - -------------------------
  862.  
  863. From: e-sink@uiuc.edu (Eric W. Sink)
  864. Date: 3 Mar 92 18:17:03 GMT
  865. Organization: University of Illinois at Urbana-Champaign
  866.  
  867. In <1992Mar3.125409.6693@hubcap.clemson.edu> wbridgm@hubcap.clemson.edu (William T. Bridgman) writes:
  868.  
  869. >/************ Class Definition ************/
  870. >class CSample {
  871. >    char name[LENGTH];
  872. >public:
  873. >    void initialize(char n[]);
  874. >    void print(void);
  875. >};
  876.  
  877. I would declare initialize as void initialize(char *);
  878.  
  879. Keep in mind that the CSample object is (probably) a relocatable
  880. handle, and you should lock it before passing a pointer to its
  881. contents to a non-trivial routine like printf.
  882.  
  883. - -- 
  884. Eric W. Sink,  Spatial Analysis and Systems Team
  885. USACERL, P.O. Box 9005, Champaign, IL 61826-9005
  886. 1-800-USA-CERL x449,   e-sink@uiuc.edu
  887.  
  888. ---------------------------
  889.  
  890. From: lim@iris.ucdavis.edu (Lloyd Lim)
  891. Subject: FixMul tip
  892. Date: 3 Mar 92 12:42:46 GMT
  893. Organization: U.C. Davis - Department of Electrical Engineering and Computer Science
  894.  
  895. Here's a tip for people who use Fixed and Fract math.  Although it's not
  896. stated explicitly in IM I, FixMul can be used with other types in the
  897. same way as FracMul.  This is rather obvious, but I never thought about
  898. it until I happened to have both IM I and IM IV open next to each other
  899. today.
  900.  
  901. In the style of IM IV, you can also add the following to the
  902. description of FixMul:
  903.  
  904. Note that FixMul effects "type * Fixed -> type":
  905.  
  906. Fixed   * Fixed   -> Fixed
  907. LONGINT * Fixed   -> LONGINT
  908. Fixed   * LONGINT -> LONGINT
  909. Fract   * Fixed   -> Fract
  910. Fixed   * Fract   -> Fract
  911.  
  912. Figuring out why this works is left as an exercise for the reader.  :-)
  913.  
  914. +++
  915. Lloyd Lim     Internet: lim@iris.cs.ucdavis.edu
  916.               America Online: LimUnltd
  917.               Compuserve: 72647,660
  918.               US Mail: 224 Lysle Leach Hall, U.C. Davis, Davis, CA 95616
  919.  
  920. - -------------------------
  921.  
  922. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  923. Date: 4 Mar 92 15:28:36 +1300
  924. Organization: University of Waikato, Hamilton, New Zealand
  925.  
  926. In article <11358@ucdavis.ucdavis.edu>, lim@iris.ucdavis.edu (Lloyd Lim)
  927. points out that FixMul will multiply a value of any of a bunch of types by a
  928. Fixed to return a value of the same type.
  929.  
  930. Yup, and a similar thing goes for FixDiv and FixRatio, too--they will divide
  931. two values of the same type to return a value of type Fixed. Note that
  932. FixDiv is just a 32-bit version of FixRatio; the only reasons left to use
  933. FixRatio instead of FixDiv are: 1) since it works on 16-bit rather than
  934. 32-bit arguments, it may be faster; or 2) you still want to maintain
  935. compatibility with the 64K ROM.
  936.  
  937.  
  938.  
  939.  
  940. (OK, maybe I *should* have put a smiley on that second reason...)
  941.  
  942. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  943. Computer Services Dept                     fax: +64-7-838-4066
  944. University of Waikato            electric mail: ldo@waikato.ac.nz
  945. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
  946. Chemist invents new edible metal, calls it "iumium".
  947.  
  948. - -------------------------
  949.  
  950. From: lim@iris.ucdavis.edu (Lloyd Lim)
  951. Date: 4 Mar 92 12:21:09 GMT
  952. Organization: U.C. Davis - Department of Electrical Engineering and Computer Science
  953.  
  954. In article <1992Mar4.152836.6777@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  955. >In article <11358@ucdavis.ucdavis.edu>, lim@iris.ucdavis.edu (Lloyd Lim)
  956. >points out that FixMul will multiply a value of any of a bunch of types by a
  957. >Fixed to return a value of the same type.
  958. >
  959. >Yup, and a similar thing goes for FixDiv and FixRatio, too--they will divide
  960. >two values of the same type to return a value of type Fixed. Note that
  961. >FixDiv is just a 32-bit version of FixRatio; the only reasons left to use
  962. >FixRatio instead of FixDiv are: 1) since it works on 16-bit rather than
  963. >32-bit arguments, it may be faster; or 2) you still want to maintain
  964. >compatibility with the 64K ROM.
  965.  
  966. Thanks, Lawrence.  I guess I overlooked FixRatio because it doesn't take
  967. Fixed or Fracts, only 16-bit numbers, like you pointed out.
  968.  
  969. I didn't mention the behavior of FixDiv because it is documented in
  970. IM IV.  FixMul was documented in IM I, before Fracts came around, so
  971. the notes about return types aren't there.
  972.  
  973. My 5 year old cousin uses a hand-me-down 512K Mac.  I have a hard time
  974. explaining to my aunt and uncle why all of the software I write doesn't
  975. work on their Macintosh.  :-(
  976.  
  977. +++
  978. Lloyd Lim     Internet: lim@iris.cs.ucdavis.edu
  979.               America Online: LimUnltd
  980.               Compuserve: 72647,660
  981.               US Mail: 224 Lysle Leach Hall, U.C. Davis, Davis, CA 95616
  982.  
  983. ---------------------------
  984.  
  985. From: rc05@gte.com (Ramesh Chandak)
  986. Subject: Very Simple Questions
  987. Date: 3 Mar 92 17:40:09 GMT
  988. Organization: GTE Laboratories Incorporated, Waltham MA
  989.  
  990. For lack of appropriate language newsgroups, I'm posting this to the
  991. newsgroups I thought would be okay. These are very elementary questions 
  992. about programming constructs and syntax ; i hope to get a quick response
  993. from the net; hence the posting. 
  994.  
  995. ( a ) how do you define a subroutine in BASIC ?
  996.       how do you pass arguments to it ?
  997.       eg. can you say 
  998.       sub example( x y )
  999.         ...
  1000.         ...
  1001.         ...
  1002.       end sub
  1003.  
  1004. ( b ) can one write recursive code in BASIC ? if not, how do u represent
  1005.       recursive code in BASIC ? for example the famous fibonacci sequence
  1006.  
  1007. ( c ) in C, one can write a forever loop as
  1008.       for ( ;; ) {
  1009.            ...
  1010.       }
  1011.       how do you write it in BASIC and FORTRAN ?
  1012.  
  1013. ( d ) in C, one can get out of a FOR loop using a break statement ;
  1014.       how do you get out of it in BASIC and FORTRAN ?
  1015.  
  1016. please email your responses to Ramesh at rc05@gte.com. Thanx.
  1017.  
  1018. - -------------------------
  1019.  
  1020. From: bobp@hal.com (Bob Pendelton)
  1021. Organization: HaL Computer Systems, Inc.
  1022. Date: Tue, 3 Mar 1992 21:31:42 GMT
  1023.  
  1024. At the risk of sounding pedantic, and in hopes of heading off the
  1025. flame war building behind this question, I have to ask; Which BASIC
  1026. and which FORTRAN? If the answer is ANSI standard FORTRAN and BASIC, I
  1027. have ask which ANSI standard. If you mean a specific IMPLEMENTATION of
  1028. these languages, please state which implementation you are asking
  1029. about.
  1030.  
  1031. You see, there are at least half a dozen different implementations of
  1032. each of these languages on PCLones, many more when you cross over into
  1033. other machines, and they are all different.
  1034.  
  1035.             Bob P.
  1036.  
  1037. P.S.
  1038.  
  1039. Very bad karma to cross post to a mac group and a ibm.pc group, very
  1040. bad indeed...
  1041.  
  1042. - -- 
  1043.  
  1044. | Bob Pendleton              | Engineering Anathema:                     |
  1045. | bobp@hal.com               |   1) You've earned an "I told you so."    |
  1046. | Speaking only for myself.  |   2) Our customers don't do that.         |
  1047.  
  1048. ---------------------------
  1049.  
  1050. From: mas@boulder.colorado.edu (Mark A. Steele)
  1051. Subject: "Please insert disk ^0" Help
  1052. Date: 3 Mar 92 23:01:05 GMT
  1053. Organization: National Geophyical Data Center, Boulder, Colorado
  1054.  
  1055. I am writing an app that requires a specific disk to be mounted.
  1056. The "Please insert Disk ^0" dialog is the way I would like to go.
  1057.  
  1058. Is this particular dialog (and filter) predefined in the Mac
  1059. ToolBox somewhere or will I have to design and write my own?
  1060.  
  1061. If I must write my own, is there sample code for how this might
  1062. be done? (I have a rather simple version running, but I don't 
  1063. know what all should go into the event loop, and sometimes it
  1064. crashes)
  1065.  
  1066. - -Mark Steele
  1067. mas@rimmer.colorado.edu
  1068.  
  1069. - -------------------------
  1070.  
  1071. From: mas@boulder.colorado.edu (Mark A. Steele)
  1072. Date: 4 Mar 92 16:50:56 GMT
  1073. Organization: National Geophyical Data Center, Boulder, Colorado
  1074.  
  1075. In article <1992Mar3.230105.14402@colorado.edu> mas@ngdc1.UUCP (Mark A. Steele) writes:
  1076. >I am writing an app that requires a specific disk to be mounted.
  1077. >The "Please insert Disk ^0" dialog is the way I would like to go.
  1078. >
  1079. >Is this particular dialog (and filter) predefined in the Mac
  1080. >ToolBox somewhere or will I have to design and write my own?
  1081. >
  1082. >If I must write my own, is there sample code for how this might
  1083. >be done? (I have a rather simple version running, but I don't 
  1084. >know what all should go into the event loop, and sometimes it
  1085. >crashes)
  1086. >
  1087. >-Mark Steele
  1088. >mas@rimmer.colorado.edu
  1089. >
  1090. I thank the people who have responded to my question, I feel that I
  1091. might want to elaborate on what I need a little bit more.
  1092.  
  1093. The app sits on the hard drive, and requires a specific CD-ROM to be
  1094. inserted. I want to make sure that the users have placed the CD into
  1095. the drive before I continue (the CD contains a database and needs to
  1096. be accessed by several platforms, that and our time and cost don't
  1097. justify having the Macintosh app sit on the CD itself).
  1098.  
  1099. What I want to do is:
  1100.     Check to see if a volume is mounted (this works)
  1101.     If it isn't mounted then put up a modal dialog
  1102.         requesting the named disk. (this works)
  1103.     In the modal filter, request a disk inserted event (works)
  1104.     If the disk is inserted, find out the name (works)
  1105.     If the names are the same, I assume the correct disk is
  1106.         inserted and return TRUE (crashes)
  1107.     If none of the above is true, eject the just inserted disk
  1108.         if disk insert event and return FALSE (sorta works).
  1109.  
  1110. Now the big question is how to deal with the two events in the filter
  1111. one is passed in via parameters, the other one is declared locally for
  1112. the disk insert event; should I reuse the parameter event? Does anybody
  1113. have a better idea for polling for a specific disk?
  1114.  
  1115. - -Mark Steele
  1116. mas@rimmer.colorado.edu
  1117.  
  1118. ---------------------------
  1119.  
  1120. From: frain@cis.ksu.edu (Jerry Frain)
  1121. Subject: Error recovery in THINK C (was Re: Suggestion to the Developers of Think C)
  1122. Date: 4 Mar 92 07:37:24 GMT
  1123. Organization: Kansas State University
  1124.  
  1125. Before you hit 'n' because this article is so long and boring, I have
  1126. two suggestions to add:
  1127.  
  1128.     1) error recovery should be an option in THINK C
  1129.  
  1130.     2) implement a key sequence to parse the error list, and take
  1131.            the cursor to the file and line of the next error [like the
  1132.        next-error function (ESC-` macro) in emacs]
  1133.  
  1134. Now, on with the follow-up:
  1135.  
  1136. chait@cs.umass.edu writes:
  1137.  
  1138. > In article <10052@tamsun.tamu.edu>, bpb9204@tamsun.tamu.edu (Brent) writes...
  1139.  
  1140. >>I definitely agree with Brian on this point.  That is the one "feature"
  1141. >>of Think C that I truly hate.  I'm taking a compiler design course now
  1142. >>. . . . 
  1143. >>A logfile would free programmers from the "let's find the next error
  1144. >>and recompile" methodology/rut that Think C FORCES us into.
  1145.  
  1146. > I have to disagree with Bren on this point for the same reason that has been
  1147. > pointed up numerous times: having it stop is advantageous in most cases.
  1148.  
  1149. Not providing error recover is typically NOT advantageous, unless you
  1150. lead a really, really boring life and like to recompile your program a
  1151. lot.
  1152.  
  1153. For every error in a file, that file has to be *completely*
  1154. recompiled.  Does that sound like a time-savings to you?
  1155.  
  1156. The worst case example is when there is an error on every line of the
  1157. program.  Without error recovery, the number of lines that are
  1158. compiled is (N * (N + 1)) / 2, where N is the number of lines in the
  1159. file.
  1160.  
  1161. With error recovery, if the programmer correctly fixes each error
  1162. (there is that chance, and not having error recovery does not give you
  1163. that chance), 2 compiles of the entire file is necessary, and hence 2N
  1164. lines are compiled.  A little arithmetic shows us that error recover
  1165. wins if N > 2.
  1166.  
  1167. Most of my programs are larger than 2 lines.
  1168.  
  1169. Even if there are only two errors in a file, if they are in the second
  1170. half of the file, then the number of lines compiled, if a compiler does
  1171. not have error recovery, will be greater than 2N.
  1172.  
  1173. I'd *much* rather read USENET news while my file compiles in the
  1174. background, then have the whole list of errors for the file, fix them
  1175. all and recompile it once (again, while I am reading news), and be
  1176. done with it.
  1177.  
  1178. Any compiler that doesn't have error recovery is not what I would call
  1179. a ``production-level'' compiler.
  1180.  
  1181. > One thing I always hated about MPW was letting it compile for ten
  1182. > minutes, only to find some hundred errors, all cascading off of one
  1183. > or two minor problems.
  1184.  
  1185. Sounds like a bad experience with a single compiler, causing you to
  1186. make sweeping generalizations about error recover in general.
  1187.  
  1188. > Logfiles do not IMHO make programming easier, it just forces you to
  1189. > compile the whole darn file before finding out what's wrong.
  1190.  
  1191. Yah, but then you can fix *everything* that's wrong before recompiling
  1192. it just one more time.
  1193.  
  1194. > And to Brian: I don't normally have 100 files to recompile, because
  1195. > I'm working error by error, rather than making changes to 100 files
  1196. > and seeing if they worked out correctly.
  1197.  
  1198. While this typical of programs being developed from scratch, try
  1199. porting a large program to the Mac (or even to THINK C 5.0, if the
  1200. program was developed using a different Mac compiler) some time.
  1201.  
  1202. > If anything, I program faster in Think C because of the quick
  1203. > find-and-fix-error system.
  1204.  
  1205. I believe that compilers that don't implement error recovery provide
  1206. this illusion of development speed because the code is compiled, and
  1207. WHAM, control is returned to the programmer quickly upon detecting the
  1208. first error.
  1209.  
  1210. Users rarely count the number of times that they tell the compiler to
  1211. recompile a file before they get to compile completely.
  1212.  
  1213.   --Jerry Frain, frain@cis.ksu.edu
  1214.  
  1215. - -------------------------
  1216.  
  1217. From: rsfinn@concerto.lcs.mit.edu (Russell S. Finn)
  1218. Date: 4 Mar 92 18:12:26 GMT
  1219. Organization: MIT Laboratory for Computer Science
  1220.  
  1221. In article <frain.699696986@depot.cis.ksu.edu>, frain@cis.ksu.edu (Jerry Frain) writes:
  1222. |> The worst case example is when there is an error on every line of the
  1223. |> program.  Without error recovery, the number of lines that are
  1224. |> compiled is (N * (N + 1)) / 2, where N is the number of lines in the
  1225. |> file.
  1226.  
  1227. But this is an unrealistic argument.  If you write a program with an
  1228. error on every line, then you've got worse problems than whether or
  1229. not the compiler stops on the first error.  THINK C's approach makes
  1230. sense if you assume that errors are sparsely distributed in a source
  1231. file, which is a reasonable assumption under normal circumstances.
  1232.  
  1233. In fact, I imagine that the majority of the time a file is compiled,
  1234. it contains no errors at all.  If that is the normal case, then why
  1235. not optimize for it?
  1236.  
  1237. |> With error recovery, if the programmer correctly fixes each error
  1238. |> (there is that chance, and not having error recovery does not give you
  1239. |> that chance), 2 compiles of the entire file is necessary, and hence 2N
  1240. |> lines are compiled.
  1241.  
  1242. You seem to be arguing a worst-case scenario on the one hand, and a
  1243. best-case scenario on the other, which hardly seems fair.
  1244.  
  1245. |> Any compiler that doesn't have error recovery is not what I would call
  1246. |> a ``production-level'' compiler.
  1247.  
  1248. Then you'll be surprised to learn that a large amount of the
  1249. commercially available software for the Macintosh was written with a
  1250. "sub-production-level" compiler.
  1251.  
  1252. |> > And to Brian: I don't normally have 100 files to recompile, because
  1253. |> > I'm working error by error, rather than making changes to 100 files
  1254. |> > and seeing if they worked out correctly.
  1255. |> 
  1256. |> While this [is] typical of programs being developed from scratch, try
  1257. |> porting a large program to the Mac (or even to THINK C 5.0, if the
  1258. |> program was developed using a different Mac compiler) some time.
  1259.  
  1260. OK, you've got a point there (I've done some ports myself).  Under
  1261. such circumstances, THINK C's approach is possibly less useful.
  1262. However, it's hardly impossible, as you seem to suggest.  I ported the
  1263. latest versions of Bison and Flex to THINK C 5.0 in about half an hour.
  1264.  
  1265. * * *
  1266.  
  1267. The idea behind THINK C, which you seem unwilling to accept, is that
  1268. compilation (and linking) speed is of the greatest importance.  
  1269.  
  1270. You seem to be making a lot of unnecessarily strong arguments which
  1271. essentially boil down to "I don't like THINK C because it doesn't have
  1272. error recovery."  Fine; then don't use it.  There are alternatives.
  1273. But don't suggest that those of us who use and like it have been
  1274. deluded into using low-quality software.
  1275.  
  1276. - -- Russell S. Finn
  1277. rsfinn@lcs.mit.edu
  1278.  
  1279. - -------------------------
  1280.  
  1281. From: frain@cis.ksu.edu (Jerry Frain)
  1282. Date: 5 Mar 92 01:02:40 GMT
  1283. Organization: Kansas State University
  1284.  
  1285. rsfinn@concerto.lcs.mit.edu (Russell S. Finn) writes:
  1286.  
  1287. > In article <frain.699696986@depot.cis.ksu.edu>, frain@cis.ksu.edu (Jerry Frain) writes:
  1288.  
  1289. [ I present a worst case approach argument to support error-recovery ]
  1290.  
  1291. > But this is an unrealistic argument.  If you write a program with an
  1292. > error on every line, then you've got worse problems than whether or
  1293. > not the compiler stops on the first error.
  1294.  
  1295. This is quite true, which is why I stated the following in the
  1296. original article, which you conveniently cut out:
  1297.  
  1298. = Even if there are only two errors in a file, if they are in the second
  1299. = half of the file, then the number of lines compiled, if a compiler does
  1300. = not have error recovery, will be greater than 2N.
  1301.  
  1302. > |> Any compiler that doesn't have error recovery is not what I would call
  1303. > |> a ``production-level'' compiler.
  1304.  
  1305. > Then you'll be surprised to learn that a large amount of the
  1306. > commercially available software for the Macintosh was written with a
  1307. > "sub-production-level" compiler.
  1308.  
  1309. No, actually it does not surprise me at all.
  1310.  
  1311. > |> While this [is] typical of programs being developed from scratch, try
  1312. > |> porting a large program to the Mac (or even to THINK C 5.0, if the
  1313. > |> program was developed using a different Mac compiler) some time.
  1314.  
  1315. > OK, you've got a point there (I've done some ports myself).  Under
  1316. > such circumstances, THINK C's approach is possibly less useful.
  1317.  
  1318. *Possibly*?  Very gracious of you to let me have that one.
  1319.  
  1320. > However, it's hardly impossible, as you seem to suggest.
  1321.  
  1322. I suggested no such thing.  90% of my programming under THINK C is
  1323. porting (which is one of the reasons I am a big advocate for error
  1324. recovery).
  1325.  
  1326. > The idea behind THINK C, which you seem unwilling to accept, is that
  1327. > compilation (and linking) speed is of the greatest importance.
  1328.  
  1329. The speed at which N lines of code may be compiled is less important,
  1330. IMHO, than the total time spent compiling N lines until the N lines
  1331. are correct.  This is where error recovery is a win.
  1332.  
  1333. Obviously, most compiling is done during development.  It is quite
  1334. natural that if parts of a program are compiled less often, the
  1335. development time is likely to be shorter.
  1336.  
  1337. > You seem to be making a lot of unnecessarily strong arguments which
  1338. > essentially boil down to "I don't like THINK C because it doesn't have
  1339. > error recovery."
  1340.  
  1341. Actually no, I use THINK C quite often, but that doesn't mean it can't
  1342. be improved.  One way I believe it can be improved is the addition of
  1343. error recovery.
  1344.  
  1345. > But don't suggest that those of us who use and like it have been
  1346. > deluded into using low-quality software.
  1347.  
  1348. I am not questioning the quality of THINK C, it is a fine product.
  1349. However, I am suggesting a way to improve it, IMHO.
  1350.  
  1351.   --Jerry Frain, frain@cis.ksu.edu
  1352.  
  1353.  
  1354. - -------------------------
  1355.  
  1356. From: rsfinn@concerto.lcs.mit.edu (Russell S. Finn)
  1357. Organization: MIT Laboratory for Computer Science
  1358. Date: Fri, 6 Mar 1992 00:24:41 GMT
  1359.  
  1360. OK, let me see if I can get myself out of this one:
  1361.  
  1362. In article <frain.699758784@depot.cis.ksu.edu>, frain@cis.ksu.edu (Jerry Frain) writes:
  1363. |> rsfinn@concerto.lcs.mit.edu (Russell S. Finn) writes:
  1364. |> 
  1365. |> [ I present a worst case approach argument to support error-recovery ]
  1366. |> 
  1367. |> > But this is an unrealistic argument.  If you write a program with an
  1368. |> > error on every line, then you've got worse problems than whether or
  1369. |> > not the compiler stops on the first error.
  1370. |> 
  1371. |> This is quite true, which is why I stated the following in the
  1372. |> original article, which you conveniently cut out:
  1373. |> 
  1374. |> = Even if there are only two errors in a file, if they are in the second
  1375. |> = half of the file, then the number of lines compiled, if a compiler does
  1376. |> = not have error recovery, will be greater than 2N.
  1377.  
  1378. I cut down quotes to keep the bandwidth down, not out of any attempt
  1379. to take comments out of context.  If you feel that I misrepresented
  1380. your argument in my reply, then I may have misunderstood the point you
  1381. were trying to make.
  1382.  
  1383. In your two-error case, the expected number of lines compiled without
  1384. error recovery is 2.5N, as opposed to 2N, a 20% difference.
  1385.  
  1386. |> > OK, you've got a point there (I've done some ports myself).  Under
  1387. |> > such circumstances, THINK C's approach is possibly less useful.
  1388. |> 
  1389. |> *Possibly*?  Very gracious of you to let me have that one.
  1390.  
  1391. Geez, I'm not picking on you; I've never met you.  I'm just presenting
  1392. my side of the discussion.
  1393.  
  1394. |> > The idea behind THINK C, ..., is that
  1395. |> > compilation (and linking) speed is of the greatest importance.
  1396. |> 
  1397. |> The speed at which N lines of code may be compiled is less important,
  1398. |> IMHO, than the total time spent compiling N lines until the N lines
  1399. |> are correct.  This is where error recovery is a win.
  1400.  
  1401. In your opinion, yes, but not in the opinion of the designer of THINK
  1402. C, one can infer.  You left out the part of *my* message that claims
  1403. that most compilations encounter few errors or none at all, so
  1404. optimizing for this case is reasonable; I assume this means you
  1405. disagree with that view.
  1406.  
  1407. We're making a lot of fuss over nothing, so let me back out as
  1408. gracefully as I can manage (if that doesn't violate the Usenet code of
  1409. conduct :-).  We obviously disagree over the importance of adding
  1410. error recovery to THINK C; we can both look forward to THINK C 6.0 to
  1411. see what changes have been made.  
  1412.  
  1413. (Acutally, I wouldn't mind the compiler being modified to handle error
  1414. recovery if (a) it didn't slow the compiler down appreciably, or (b)
  1415. it was a user-configurable option, like optimizaton is now -- or even
  1416. along the lines of holding down the option key when compiling to
  1417. invoke error recovery mode.)
  1418.  
  1419. - -- Russell S. Finn
  1420. rsfinn@lcs.mit.edu
  1421.  
  1422. ---------------------------
  1423.  
  1424. End of C.S.M.P. Digest
  1425. **********************
  1426.